import errorCodes from './errorCodes';
import statusCodes from './statusCodes';
const errorCallback = (msg: string) => {
  // tslint:disable-next-line: no-console
  console.log('接口错误后统一做些操作吧');
};
const requestBeforeCallback = (config) => {
  config.headers.Authorization = `Bearer 111111`; // 请求头不能是中文
  return config;
};
const requestAfterCallback = (res) => {
  console.log(res)
};

const requestConfig = {
  name: 'http',
  host: '',
  timeout: 30000,
  errorCodes,
  statusCodes,
  errorCallback,
  requestBeforeCallback,
  requestAfterCallback,
  successCodes: [0, 200, null],
}
// 抛出请求配置
// 也可以根据环境变量来初始化你的请求
export default requestConfig;
